import { api } from '../lib/axios'

// 类型定义
export interface Comment {
  id: number
  postId: number
  name: string
  email: string
  body: string
}

// API 服务函数
export const apiService = {
  // 获取所有评论
  getComments: async (): Promise<Comment[]> => {
    const response = await api.get('/comments')
    return response.data
  },
}
